from typing import Optional, List

from pydantic import BaseModel, Field


class BaseQo(BaseModel):
    params: dict = {}

class DetailParam(BaseModel):
    id: int = None

class BaseListQo(BaseQo):
    pageNum: int = 1
    pageSize: int = 10

class DocumentListQo(BaseListQo):
    kb_id: int = None
    status: Optional[str] = None
    file_name: Optional[str] = None


class AIAgentListQo(BaseListQo):
    group: Optional[str] = None
    searchValue: Optional[str] = None

class AIConfigListQo(BaseListQo):
    searchValue: Optional[str] = Field(None, description="搜索值")

class DelParam(BaseModel):
    ids: list = None

class ChangeStatusParam(BaseModel):
    id: int = None
    status: str=None

class ChangeStatusToDraftParam(BaseModel):
    ids: List[int] = None



class LookupSksTableToolsUseAgentQO(BaseListQo):
    searchValue: Optional[str] = None


class LookupSksTableAiAgentUseAgentQO(BaseListQo):
    #where id not in(xxx,xxx)
    idNotIn:Optional[list[int]]=None
    searchValue: Optional[str] = None

    def idNotIn_not_none(self):
        if self.idNotIn:
            if len(self.idNotIn) >0:
                return True
        return False

class LookupSksTableKnowledgeUseAgentQO(BaseListQo):
    searchValue: Optional[str] = None
